package com.spring.provideronetest.service;

import com.spring.provideronetest.entity.User;
import com.spring.provideronetest.mapper.UserMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @auther zhangxiangtao
 * @date 2021/1/3
 */
@Service
public class UserService {
	Logger logger = LoggerFactory.getLogger(UserService.class);
	@Autowired
	UserMapper userMapper;
	public User Sel(int id){
		User user = userMapper.Sel(id);

		if(user == null){
			logger.error("数据不存在");
			throw new RuntimeException("数据不存在");
		}
		return user;
	}
}
